﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.huigo.Framework.BLL
{
    public class CustFeeInit
    {
        public static Model.CustFeeInit GetFeeInitByOrderId(string orderId)
        {
            Model.CustFeeInit feeInit = new Model.CustFeeInit();
            feeInit.InitOutPayNo = orderId;
            List<string> fields = new List<string>() 
             {  
                "INIT_CUST_FID",
                "INIT_TYPE",
                "INIT_FOR",
                "INIT_CHANNEL",
                "INIT_RELATED_FID",
                "INIT_CHANGE_FEE",
                "INIT_PAY_FEE",
                "INIT_OUT_PAY_DESC"
             };
            return SqlServerDal.CustFeeInit.GetItem(feeInit, fields, null, null);
        }

        public static bool AddCustFeeInit(long initCustFid, byte initType, byte initFor, long initRelatedFid, string initChannel, decimal initChangeFee, decimal initPayFee, string initOutPayNo, string initOutPayDesc)
        {

            Model.CustFeeInit feeInfo = new Model.CustFeeInit();
            feeInfo.InitCustFid = initCustFid;
            feeInfo.InitType = initType;
            feeInfo.InitFor = initFor;
            feeInfo.InitRelatedFid = initRelatedFid;
            feeInfo.InitChannel = initChannel;
            feeInfo.InitChangeFee = initChangeFee;
            feeInfo.InitPayFee = initPayFee;
            //feeInfo.InitMemo = statusMeno;
            //feeInfo.InitFlag = statusMeno;
            feeInfo.InitOutPayNo = initOutPayNo;
            feeInfo.InitOutPayDesc = initOutPayDesc;
            return SqlServerDal.CustFeeInit.Insert(feeInfo, null);
        }
    }
}
